package com.platform.dao;

import com.platform.dto.CheckCommissionDetailVo;
import com.platform.entity.OrderGoodsVo;
import com.platform.entity.OrderVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @author lipengjun
 * @email 939961241@qq.com
 * @date 2017-08-11 09:16:46
 */
public interface ApiOrderMapper extends BaseDao<OrderVo> {


    /**
     * 查询用户的消费额，已完成的订单，状态码为301
     *
     * @param user_id
     * @return
     */
    BigDecimal checkActualPrice(@Param("user_id") Long user_id);

    /**
     * 查询用户上一月的订单总和，实际付款，订单状态为已完成
     *
     * @param user_id
     * @return
     */
    BigDecimal checkLastMonthActualPrice(@Param("user_id") Long user_id);

    OrderVo queryTheLatestCompletedOrders(@Param("user_id") Long user_id);

    //获取提成对应订单的详情
    CheckCommissionDetailVo checkCommissionDetailByMonth(@Param("user_id") Long user_id, @Param("detail_month") String detailMobth);

    //查询最新的订单
    OrderVo queryNewestOrder(Map<String, Object> params);


    OrderVo queryById(@Param("orderId") Integer orderId);

    //更新过期订单
    void updateTimeOutOrder(@Param("user_id") Long user_id, @Param("time_limit") Integer time_limit);

    //更新普通需要确认的订单
    void updateSimpleConfirmOrder(@Param("user_id") Long user_id);

    //更新延时确认的订单
    void updateDelayConfirmOrder(@Param("user_id") Long user_id);

    //queryByOutTradeNo
    OrderVo queryByOutTradeNo(@Param("out_trade_no") String out_trade_no);

}
